package com.itheima.idea;

public class Demo4Method {
    public static void main(String[] args) {
        int num = s(72);
        System.out.println("总共有"+num+"只兔子");
    }

    public static int s(int m) {
        int[] arr = new int[m];
        if (m < 0) {

            return -1;
        }
        if (m == 1 || m == 2) {
            return 1;
        } else {
            arr[0] = 1;
            arr[1] = 1;
            for (int i = 2; i < arr.length; i++) {
                arr[i] = arr[i - 1] + arr[i - 2];

            }
            return arr[m - 1];

        }


    }

}